package com.sxhuayuan.parking.entity;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import com.sxhuayuan.parking.config.PayMode;
import com.sxhuayuan.parking.config.PayStatus;
import com.sxhuayuan.parking.config.Platform;

/** 月卡的充值订单记录*/
/** 所有精度整型全部用字符保存 */
@Entity
@Table(name = "hypk_month_card_order")
public class MonthCardOrder extends BaseEntity {

	private static final long serialVersionUID = -73936000202964750L;

	/** 支付金额 */
	private BigDecimal money;
	/** 缴费月数 */
	private Integer monthCount;
	/** 子商户号 */
	private String mchid;
	/** 华贝订单号 */
	private String tradeNo;
	/** 支付是否成功 */
	private PayStatus payStatus;
	/** 订单编号 */
	private String sn;
	/** 车牌号 */
	private String carPlate;
	/** 支付类别 */
	private Platform platform;
	/** 支付方式 */
	private PayMode payMode;
	/** 接口通知成功 */
	private Boolean isNoticeSuccess;

	/** 第三方月卡缴费订单编号 */
	private String lotOrderNo;
	/** 分为第一次开通和续费 */
	public Boolean isFirst; // 0 1
	/** 缴费前的过期时间, yyyy-MM-dd */
	public String currExpierDate;
	/** 缴费后的过期时间 */
	public String preExpireDate;
	/** 缴费的类型标识 */
	public String tariffID;
	/** 缴费类型名称 */
	public String tariffName;
	/** 月租，元 */
	private Integer monthlyRent;
	/** 用户 */
	private Member member;
	/** 车场 */
	private ParkingLot parkingLot;

	@Column(precision = 10, scale = 2)
	public BigDecimal getMoney() {
		return money;
	}

	public void setMoney(BigDecimal money) {
		this.money = money;
	}

	public Integer getMonthCount() {
		return monthCount;
	}

	public void setMonthCount(Integer monthCount) {
		this.monthCount = monthCount;
	}

	@Column(length = 64)
	public String getMchid() {
		return mchid;
	}

	public void setMchid(String mchid) {
		this.mchid = mchid;
	}

	@Column(length = 64)
	public String getTradeNo() {
		return tradeNo;
	}

	public void setTradeNo(String tradeNo) {
		this.tradeNo = tradeNo;
	}

	public PayStatus getPayStatus() {
		return payStatus;
	}

	public void setPayStatus(PayStatus payStatus) {
		this.payStatus = payStatus;
	}

	@NotNull
	@Column(length = 64, nullable = false, unique = true)
	public String getSn() {
		return sn;
	}

	public void setSn(String sn) {
		this.sn = sn;
	}

	@Column(length = 32)
	public String getCarPlate() {
		return carPlate;
	}

	public void setCarPlate(String carPlate) {
		this.carPlate = carPlate;
	}

	public Platform getPlatform() {
		return platform;
	}

	public void setPlatform(Platform platform) {
		this.platform = platform;
	}

	public PayMode getPayMode() {
		return payMode;
	}

	public void setPayMode(PayMode payMode) {
		this.payMode = payMode;
	}

	public Boolean getIsNoticeSuccess() {
		return isNoticeSuccess;
	}

	public void setIsNoticeSuccess(Boolean isNoticeSuccess) {
		this.isNoticeSuccess = isNoticeSuccess;
	}

	@Column(length = 64)
	public String getLotOrderNo() {
		return lotOrderNo;
	}

	public void setLotOrderNo(String lotOrderNo) {
		this.lotOrderNo = lotOrderNo;
	}

	@Column(length = 16)
	public String getCurrExpierDate() {
		return currExpierDate;
	}

	public void setCurrExpierDate(String currExpierDate) {
		this.currExpierDate = currExpierDate;
	}

	@Column(length = 16)
	public String getPreExpireDate() {
		return preExpireDate;
	}

	public void setPreExpireDate(String preExpireDate) {
		this.preExpireDate = preExpireDate;
	}

	public Boolean getIsFirst() {
		return isFirst;
	}

	public void setIsFirst(Boolean isFirst) {
		this.isFirst = isFirst;
	}

	@Column(length = 16)
	public String getTariffID() {
		return tariffID;
	}

	public void setTariffID(String tariffID) {
		this.tariffID = tariffID;
	}

	public Integer getMonthlyRent() {
		return monthlyRent;
	}

	public void setMonthlyRent(Integer monthlyRent) {
		this.monthlyRent = monthlyRent;
	}

	@Column(length = 32)
	public String getTariffName() {
		return tariffName;
	}

	public void setTariffName(String tariffName) {
		this.tariffName = tariffName;
	}

	@JoinColumn(name = "member_id")
	@ManyToOne(fetch = FetchType.LAZY)
	public Member getMember() {
		return member;
	}

	public void setMember(Member member) {
		this.member = member;
	}

	@JoinColumn(name = "parking_lot_id")
	@ManyToOne(fetch = FetchType.LAZY)
	public ParkingLot getParkingLot() {
		return parkingLot;
	}

	public void setParkingLot(ParkingLot parkingLot) {
		this.parkingLot = parkingLot;
	}
}
